<template>
  <span class="notranslate">{{price}}</span>
</template>

<script>
import { currency } from '@/utils/filters';
import { mapGetters } from 'vuex';
export default {
    props: {
        value: {
            type: [String, Number],
            default: 0
        },
        params: {
            type: Object,
            default: () => {
                return {
                    symbol: '$',
                    decimals: 2
                };
            }
        }
    },
    computed: {
        ...mapGetters(['siteList']),
        siteId () {
            return this.$store.state.user.siteId;
        },
        siteInfo () {
            let info = this.siteList.find(res => res.id === Number(this.siteId));
            return info;
        },
        price () {
            // console.log(this.exchangeRatesSwitchCode);
            return currency(this.value, (this.siteInfo.currencySymbol || '$'), this.params.decimals);
        }
    }
};
</script>
